home *** CD-ROM | disk | FTP | other *** search
- class StraightMissile extends Missile
- {
- var angleRad;
- var tm;
- var mc;
- var newAngle;
- var dm;
- static var MAX_SPEED = 10;
- static var DAMAGE = 3;
- static var MISSILE_TIMER = 60;
- static var GRACE_TIMER = 3;
- static var missiles = new ObjectList();
- function StraightMissile(x, y, newAngle)
- {
- super(x,y,newAngle);
- this.angleRad = CustomMath.degToRad(newAngle);
- this.xspeed = Math.cos(this.angleRad) * this.getMaxSpeed();
- this.yspeed = Math.sin(this.angleRad) * this.getMaxSpeed();
- }
- function getMaxSpeed()
- {
- return StraightMissile.MAX_SPEED;
- }
- function getDamage()
- {
- return StraightMissile.DAMAGE;
- }
- function getMissileTimer()
- {
- return StraightMissile.MISSILE_TIMER;
- }
- function getGraceTimer()
- {
- return StraightMissile.GRACE_TIMER;
- }
- function createTrailManager()
- {
- this.tm = new EfficientTrailManager(this.mc,this.mc.exhaust1,4,_root.effects < 3 ? null : 16226057,this.getTrailLength(),true,100,this.newAngle);
- }
- function createDebrisManager()
- {
- if(_root.effects >= 2)
- {
- this.dm = new DebrisManager(16226057,1);
- }
- }
- function createSound()
- {
- SoundManager.fireOrangeMissile();
- }
- function followPlayer()
- {
- this.mc._x += this.xspeed;
- this.mc._y += this.yspeed;
- this.tm.makeTrail(this.angleRad);
- }
- function hit(m, shapeFlag, isPlayer)
- {
- if(isPlayer || !this.isGrace())
- {
- var _loc2_ = CustomMath.degToRad(this.newAngle);
- return m.hitTest(this.mc._x,this.mc._y,shapeFlag) || m.hitTest(this.mc._x + Math.cos(_loc2_) * (this.getMaxSpeed() >> 1),this.mc._y + Math.sin(_loc2_) * (this.getMaxSpeed() >> 1),shapeFlag);
- }
- return false;
- }
- }
-